<!DOCTYPE html><html lang="zh-CN" data-theme="light"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0,viewport-fit=cover"><title>觅思文档使用系列(一) | 小苑の博客</title><meta name="author" content="coderyh"><meta name="copyright" content="coderyh"><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="#ffffff"><meta name="description" content="觅思文档：介绍  官方网站 MrDoc安装手册   MrDoc 基于 Python3 语言的 Django 框架编写而成。 123456# 测试运行python manage.py runserver 0.0.0.0:8080# 我自己设置的测试账号和密码coderyhcoderyhpassw0rd    觅思文档：文集导入和导出 进入个人中心 –&gt; 我的文集 –&gt; 文集管理 –&amp;gt">
<meta property="og:type" content="article">
<meta property="og:title" content="觅思文档使用系列(一)">
<meta property="og:url" content="http://localhost:4000/blog/20240105205323/index.html">
<meta property="og:site_name" content="小苑の博客">
<meta property="og:description" content="觅思文档：介绍  官方网站 MrDoc安装手册   MrDoc 基于 Python3 语言的 Django 框架编写而成。 123456# 测试运行python manage.py runserver 0.0.0.0:8080# 我自己设置的测试账号和密码coderyhcoderyhpassw0rd    觅思文档：文集导入和导出 进入个人中心 –&gt; 我的文集 –&gt; 文集管理 –&amp;gt">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="http://localhost:8080/image?2024-01-05%2020:53:23">
<meta property="article:published_time" content="2024-01-05T12:53:23.000Z">
<meta property="article:modified_time" content="2024-01-05T12:54:05.246Z">
<meta property="article:author" content="coderyh">
<meta property="article:tag" content="默认标签">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="http://localhost:8080/image?2024-01-05%2020:53:23"><link rel="shortcut icon" href="/blog/img/favicon.png"><link rel="canonical" href="http://localhost:4000/blog/20240105205323/index.html"><link rel="preconnect" href="//cdn.jsdelivr.net"/><link rel="preconnect" href="//busuanzi.ibruce.info"/><link rel="stylesheet" href="/blog/css/index.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free/css/all.min.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox/fancybox.min.css" media="print" onload="this.media='all'"><script>const GLOBAL_CONFIG = {
  root: '/blog/',
  algolia: undefined,
  localSearch: {"path":"/blog/./search.xml","preload":false,"top_n_per_article":1,"unescape":false,"languages":{"hits_empty":"找不到您查询的内容：${query}","hits_stats":"共找到 ${hits} 篇文章"}},
  translate: {"defaultEncoding":2,"translateDelay":0,"msgToTraditionalChinese":"繁","msgToSimplifiedChinese":"簡"},
  noticeOutdate: {"limitDay":365,"position":"top","messagePrev":"It has been","messageNext":"days since the last update, the content of the article may be outdated."},
  highlight: {"plugin":"highlight.js","highlightCopy":true,"highlightLang":true,"highlightHeightLimit":false},
  copy: {
    success: '复制成功',
    error: '复制错误',
    noSupport: '浏览器不支持'
  },
  relativeDate: {
    homepage: false,
    post: false
  },
  runtime: '天',
  dateSuffix: {
    just: '刚刚',
    min: '分钟前',
    hour: '小时前',
    day: '天前',
    month: '个月前'
  },
  copyright: undefined,
  lightbox: 'fancybox',
  Snackbar: undefined,
  infinitegrid: {
    js: 'https://cdn.jsdelivr.net/npm/@egjs/infinitegrid/dist/infinitegrid.min.js',
    buttonText: '加载更多'
  },
  isPhotoFigcaption: true,
  islazyload: false,
  isAnchor: false,
  percent: {
    toc: true,
    rightside: false,
  },
  autoDarkmode: false
}</script><script id="config-diff">var GLOBAL_CONFIG_SITE = {
  title: '觅思文档使用系列(一)',
  isPost: true,
  isHome: false,
  isHighlightShrink: false,
  isToc: true,
  postUpdate: '2024-01-05 20:54:05'
}</script><script>(win=>{
      win.saveToLocal = {
        set: (key, value, ttl) => {
          if (ttl === 0) return
          const now = Date.now()
          const expiry = now + ttl * 86400000
          const item = {
            value,
            expiry
          }
          localStorage.setItem(key, JSON.stringify(item))
        },
      
        get: key => {
          const itemStr = localStorage.getItem(key)
      
          if (!itemStr) {
            return undefined
          }
          const item = JSON.parse(itemStr)
          const now = Date.now()
      
          if (now > item.expiry) {
            localStorage.removeItem(key)
            return undefined
          }
          return item.value
        }
      }
    
      win.getScript = (url, attr = {}) => new Promise((resolve, reject) => {
        const script = document.createElement('script')
        script.src = url
        script.async = true
        script.onerror = reject
        script.onload = script.onreadystatechange = function() {
          const loadState = this.readyState
          if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
          script.onload = script.onreadystatechange = null
          resolve()
        }

        Object.keys(attr).forEach(key => {
          script.setAttribute(key, attr[key])
        })

        document.head.appendChild(script)
      })
    
      win.getCSS = (url, id = false) => new Promise((resolve, reject) => {
        const link = document.createElement('link')
        link.rel = 'stylesheet'
        link.href = url
        if (id) link.id = id
        link.onerror = reject
        link.onload = link.onreadystatechange = function() {
          const loadState = this.readyState
          if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
          link.onload = link.onreadystatechange = null
          resolve()
        }
        document.head.appendChild(link)
      })
    
      win.activateDarkMode = () => {
        document.documentElement.setAttribute('data-theme', 'dark')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#0d0d0d')
        }
      }
      win.activateLightMode = () => {
        document.documentElement.setAttribute('data-theme', 'light')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#ffffff')
        }
      }
      const t = saveToLocal.get('theme')
    
        if (t === 'dark') activateDarkMode()
        else if (t === 'light') activateLightMode()
      
      const asideStatus = saveToLocal.get('aside-status')
      if (asideStatus !== undefined) {
        if (asideStatus === 'hide') {
          document.documentElement.classList.add('hide-aside')
        } else {
          document.documentElement.classList.remove('hide-aside')
        }
      }
    
      const detectApple = () => {
        if(/iPad|iPhone|iPod|Macintosh/.test(navigator.userAgent)){
          document.documentElement.classList.add('apple')
        }
      }
      detectApple()
    })(window)</script><meta name="generator" content="Hexo 6.3.0"></head><body><div id="loading-box"><div class="loading-left-bg"></div><div class="loading-right-bg"></div><div class="spinner-box"><div class="configure-border-1"><div class="configure-core"></div></div><div class="configure-border-2"><div class="configure-core"></div></div><div class="loading-word">加载中...</div></div></div><script>(()=>{
  const $loadingBox = document.getElementById('loading-box')
  const $body = document.body
  const preloader = {
    endLoading: () => {
      $body.style.overflow = ''
      $loadingBox.classList.add('loaded')
    },
    initLoading: () => {
      $body.style.overflow = 'hidden'
      $loadingBox.classList.remove('loaded')
    }
  }

  preloader.initLoading()
  window.addEventListener('load',() => { preloader.endLoading() })

  if (false) {
    document.addEventListener('pjax:send', () => { preloader.initLoading() })
    document.addEventListener('pjax:complete', () => { preloader.endLoading() })
  }
})()</script><div id="sidebar"><div id="menu-mask"></div><div id="sidebar-menus"><div class="avatar-img is-center"><img src="/blog/img/avatar.jpg" onerror="onerror=null;src='/img/friend_404.gif'" alt="avatar"/></div><div class="sidebar-site-data site-data is-center"><a href="/blog/archives/"><div class="headline">文章</div><div class="length-num">25</div></a><a href="/blog/tags/"><div class="headline">标签</div><div class="length-num">16</div></a><a href="/blog/categories/"><div class="headline">分类</div><div class="length-num">8</div></a></div><hr class="custom-hr"/><div class="menus_items"><div class="menus_item"><a class="site-page" href="/blog/"><i class="fa-fw fas fa-home"></i><span> 首页</span></a></div><div class="menus_item"><a class="site-page group" href="javascript:void(0);"><i class="fa-fw fas fa-list"></i><span> 导航</span><i class="fas fa-chevron-down"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/blog/navigation/work/"><i class="fa-fw fas fa-coffee"></i><span> 工作</span></a></li><li><a class="site-page child" href="/blog/navigation/moyu/"><i class="fa-fw fas fa-th-list"></i><span> 摸鱼</span></a></li><li><a class="site-page child" href="/blog/navigation/code/"><i class="fa-fw fas fa-code"></i><span> 开发</span></a></li><li><a class="site-page child" href="/blog/navigation/design/"><i class="fa-fw fas fa-pencil-alt"></i><span> 设计</span></a></li><li><a class="site-page child" href="/blog/navigation/resource/"><i class="fa-fw fas fa-book"></i><span> 资源</span></a></li><li><a class="site-page child" href="/blog/navigation/tool/"><i class="fa-fw fas fa-wrench"></i><span> 工具</span></a></li><li><a class="site-page child" href="/blog/navigation/project/"><i class="fa-fw fas fa-project-diagram"></i><span> 项目</span></a></li></ul></div><div class="menus_item"><a class="site-page group" href="javascript:void(0);"><i class="fa-fw fas fa-desktop"></i><span> 软件</span><i class="fas fa-chevron-down"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/blog/software/usual/"><i class="fa-fw fas fa-desktop"></i><span> 常用</span></a></li><li><a class="site-page child" href="/blog/software/code/"><i class="fa-fw fas fa-code"></i><span> 开发</span></a></li><li><a class="site-page child" href="/blog/software/open/"><i class="fa-fw fas fa-code-branch"></i><span> 开源</span></a></li></ul></div><div class="menus_item"><a class="site-page group" href="javascript:void(0);"><i class="fa-fw fa fa-compass"></i><span> 目录</span><i class="fas fa-chevron-down"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/blog/categories/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></li><li><a class="site-page child" href="/blog/tags/"><i class="fa-fw fas fa-tags"></i><span> 标签</span></a></li><li><a class="site-page child" href="/blog/archives/"><i class="fa-fw fas fa-archive"></i><span> 归档</span></a></li></ul></div><div class="menus_item"><a class="site-page" href="/blog/gallery/"><i class="fa-fw fas fa-images"></i><span> 图库</span></a></div><div class="menus_item"><a class="site-page" href="/blog/link/"><i class="fa-fw fas fa-link"></i><span> 友链</span></a></div><div class="menus_item"><a class="site-page" href="/blog/about/"><i class="fa-fw fas fa-heart"></i><span> 关于</span></a></div><div class="menus_item"><a class="site-page group" href="javascript:void(0);"><i class="fa-fw fa fa-user"></i><span> 设置</span><i class="fas fa-chevron-down"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/blog/pro/"><i class="fa-fw fas fa-user"></i><span> 页面管理</span></a></li><li><a class="site-page child" href="/blog/admin/"><i class="fa-fw fas fa-user"></i><span> 后台管理</span></a></li><li><a class="site-page child" href="/blog/bridge/"><i class="fa-fw fas fa-cog"></i><span> 配置管理</span></a></li></ul></div></div></div></div><div class="post" id="body-wrap"><header class="post-bg" id="page-header" style="background-image: url('http://localhost:8080/image?2024-01-05 20:53:23')"><nav id="nav"><span id="blog-info"><a href="/blog/" title="小苑の博客"><span class="site-name">小苑の博客</span></a></span><div id="menus"><div id="search-button"><a class="site-page social-icon search" href="javascript:void(0);"><i class="fas fa-search fa-fw"></i><span> 搜索</span></a></div><div class="menus_items"><div class="menus_item"><a class="site-page" href="/blog/"><i class="fa-fw fas fa-home"></i><span> 首页</span></a></div><div class="menus_item"><a class="site-page group" href="javascript:void(0);"><i class="fa-fw fas fa-list"></i><span> 导航</span><i class="fas fa-chevron-down"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/blog/navigation/work/"><i class="fa-fw fas fa-coffee"></i><span> 工作</span></a></li><li><a class="site-page child" href="/blog/navigation/moyu/"><i class="fa-fw fas fa-th-list"></i><span> 摸鱼</span></a></li><li><a class="site-page child" href="/blog/navigation/code/"><i class="fa-fw fas fa-code"></i><span> 开发</span></a></li><li><a class="site-page child" href="/blog/navigation/design/"><i class="fa-fw fas fa-pencil-alt"></i><span> 设计</span></a></li><li><a class="site-page child" href="/blog/navigation/resource/"><i class="fa-fw fas fa-book"></i><span> 资源</span></a></li><li><a class="site-page child" href="/blog/navigation/tool/"><i class="fa-fw fas fa-wrench"></i><span> 工具</span></a></li><li><a class="site-page child" href="/blog/navigation/project/"><i class="fa-fw fas fa-project-diagram"></i><span> 项目</span></a></li></ul></div><div class="menus_item"><a class="site-page group" href="javascript:void(0);"><i class="fa-fw fas fa-desktop"></i><span> 软件</span><i class="fas fa-chevron-down"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/blog/software/usual/"><i class="fa-fw fas fa-desktop"></i><span> 常用</span></a></li><li><a class="site-page child" href="/blog/software/code/"><i class="fa-fw fas fa-code"></i><span> 开发</span></a></li><li><a class="site-page child" href="/blog/software/open/"><i class="fa-fw fas fa-code-branch"></i><span> 开源</span></a></li></ul></div><div class="menus_item"><a class="site-page group" href="javascript:void(0);"><i class="fa-fw fa fa-compass"></i><span> 目录</span><i class="fas fa-chevron-down"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/blog/categories/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></li><li><a class="site-page child" href="/blog/tags/"><i class="fa-fw fas fa-tags"></i><span> 标签</span></a></li><li><a class="site-page child" href="/blog/archives/"><i class="fa-fw fas fa-archive"></i><span> 归档</span></a></li></ul></div><div class="menus_item"><a class="site-page" href="/blog/gallery/"><i class="fa-fw fas fa-images"></i><span> 图库</span></a></div><div class="menus_item"><a class="site-page" href="/blog/link/"><i class="fa-fw fas fa-link"></i><span> 友链</span></a></div><div class="menus_item"><a class="site-page" href="/blog/about/"><i class="fa-fw fas fa-heart"></i><span> 关于</span></a></div><div class="menus_item"><a class="site-page group" href="javascript:void(0);"><i class="fa-fw fa fa-user"></i><span> 设置</span><i class="fas fa-chevron-down"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/blog/pro/"><i class="fa-fw fas fa-user"></i><span> 页面管理</span></a></li><li><a class="site-page child" href="/blog/admin/"><i class="fa-fw fas fa-user"></i><span> 后台管理</span></a></li><li><a class="site-page child" href="/blog/bridge/"><i class="fa-fw fas fa-cog"></i><span> 配置管理</span></a></li></ul></div></div><div id="toggle-menu"><a class="site-page" href="javascript:void(0);"><i class="fas fa-bars fa-fw"></i></a></div></div></nav><div id="post-info"><h1 class="post-title">觅思文档使用系列(一)</h1><div id="post-meta"><div class="meta-firstline"><span class="post-meta-date"><i class="far fa-calendar-alt fa-fw post-meta-icon"></i><span class="post-meta-label">发表于</span><time class="post-meta-date-created" datetime="2024-01-05T12:53:23.000Z" title="发表于 2024-01-05 20:53:23">2024-01-05</time><span class="post-meta-separator">|</span><i class="fas fa-history fa-fw post-meta-icon"></i><span class="post-meta-label">更新于</span><time class="post-meta-date-updated" datetime="2024-01-05T12:54:05.246Z" title="更新于 2024-01-05 20:54:05">2024-01-05</time></span><span class="post-meta-categories"><span class="post-meta-separator">|</span><i class="fas fa-inbox fa-fw post-meta-icon"></i><a class="post-meta-categories" href="/blog/categories/%E9%BB%98%E8%AE%A4%E5%88%86%E7%B1%BB/">默认分类</a></span></div><div class="meta-secondline"><span class="post-meta-separator">|</span><span class="post-meta-wordcount"><i class="far fa-file-word fa-fw post-meta-icon"></i><span class="post-meta-label">字数总计:</span><span class="word-count">879</span><span class="post-meta-separator">|</span><i class="far fa-clock fa-fw post-meta-icon"></i><span class="post-meta-label">阅读时长:</span><span>3分钟</span></span><span class="post-meta-separator">|</span><span class="post-meta-pv-cv" id="" data-flag-title="觅思文档使用系列(一)"><i class="far fa-eye fa-fw post-meta-icon"></i><span class="post-meta-label">阅读量:</span><span id="busuanzi_value_page_pv"><i class="fa-solid fa-spinner fa-spin"></i></span></span></div></div></div></header><main class="layout" id="content-inner"><div id="post"><article class="post-content" id="article-container"><h2 id="觅思文档：介绍"><a href="#觅思文档：介绍" class="headerlink" title="觅思文档：介绍"></a>觅思文档：介绍</h2><blockquote>
<ol>
<li><a target="_blank" rel="noopener" href="https://doc.mrdoc.pro/">官方网站</a></li>
<li><a target="_blank" rel="noopener" href="https://doc.mrdoc.pro/p/deploy/">MrDoc安装手册</a></li>
</ol>
</blockquote>
<p>MrDoc 基于 Python3 语言的 Django 框架编写而成。</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta prompt_"># </span><span class="language-bash">测试运行</span></span><br><span class="line">python manage.py runserver 0.0.0.0:8080</span><br><span class="line"><span class="meta prompt_"></span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">我自己设置的测试账号和密码</span></span><br><span class="line">coderyh</span><br><span class="line">coderyhpassw0rd</span><br></pre></td></tr></table></figure>



<h2 id="觅思文档：文集导入和导出"><a href="#觅思文档：文集导入和导出" class="headerlink" title="觅思文档：文集导入和导出"></a>觅思文档：文集导入和导出</h2><ol>
<li>进入个人中心 –&gt; 我的文集 –&gt; 文集管理 –&gt; 批量导出</li>
<li>进入个人中心 –&gt; 我的文集 –&gt; 文集管理 –&gt; 导入文集 –&gt; 选择一个文集 –&gt; 上传本地文档到选择的文集中（支持.md .docx .txt文件）</li>
</ol>
<h2 id="觅思文档：数据库分析"><a href="#觅思文档：数据库分析" class="headerlink" title="觅思文档：数据库分析"></a>觅思文档：数据库分析</h2><table>
<thead>
<tr>
<th></th>
<th>描述</th>
<th>数据库</th>
<th></th>
</tr>
</thead>
<tbody><tr>
<td></td>
<td></td>
<td>app_admin_emaiverificationcode</td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td>app_admin_registercode</td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td>app_admin_syssetting</td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td>app_admin_useroptions</td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td>app_api_appusertoken</td>
<td></td>
</tr>
<tr>
<td></td>
<td>个人管理：Token</td>
<td>app_api_usertoken</td>
<td>select * from app_api_usertoken;</td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td>文档管理：文档数据</td>
<td>app_doc_doc</td>
<td>select * from app_doc_doc;</td>
</tr>
<tr>
<td></td>
<td>文档管理：历史版本</td>
<td>app_doc_dochistory</td>
<td>select * from app_doc_dochistory;</td>
</tr>
<tr>
<td></td>
<td>文档管理：我的收藏</td>
<td>app_doc_mycollect</td>
<td>select * from app_doc_mycollect;</td>
</tr>
<tr>
<td></td>
<td>文集管理：文集数据</td>
<td>app_doc_project</td>
<td>select * from app_doc_project;</td>
</tr>
<tr>
<td></td>
<td></td>
<td>app_doc_docshare</td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td>app_doc_doctag</td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td>app_doc_doctemp</td>
<td></td>
</tr>
<tr>
<td></td>
<td>素材管理：图片</td>
<td>app_doc_image</td>
<td>select * from app_doc_image;</td>
</tr>
<tr>
<td></td>
<td>素材管理：附件</td>
<td>app_doc_attachment</td>
<td>select * from app_doc_attachment;</td>
</tr>
<tr>
<td></td>
<td></td>
<td>app_doc_imagegroup</td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td>app_doc_projectcollaborator</td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td>app_doc_projectreport</td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td>app_doc_projectreportfile</td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td>app_doc_projecttoc</td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td>app_doc_tag</td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td>auth_group</td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td>auth_group_permissions</td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td>auth_permission</td>
<td></td>
</tr>
<tr>
<td></td>
<td>用户：用户信息</td>
<td>auth_user</td>
<td>select * from auth_user;</td>
</tr>
<tr>
<td></td>
<td></td>
<td>auth_user_groups</td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td>auth_user_user_permissions</td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td>django_admin_log</td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td>django_content_type</td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td>django_migrations</td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td>django_session</td>
<td></td>
</tr>
</tbody></table>
<h2 id="觅思文档：开源版数据导入与导出"><a href="#觅思文档：开源版数据导入与导出" class="headerlink" title="觅思文档：开源版数据导入与导出"></a>觅思文档：开源版数据导入与导出</h2><blockquote>
<p>数据导出</p>
</blockquote>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">python manage.py dumpdata auth.user &gt; db_user.json &amp;&amp;</span><br><span class="line">python manage.py dumpdata app_admin &gt; db_admin.json &amp;&amp;</span><br><span class="line">python manage.py dumpdata app_doc &gt; db_doc.json</span><br></pre></td></tr></table></figure>

<blockquote>
<p>数据导入</p>
</blockquote>
<p>首先需将数据文件放置在 MrDoc 项目根目录（manage.py文件所在的目录）下。</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">python manage.py loaddata db_user.json &amp;&amp;</span><br><span class="line">python manage.py loaddata db_admin.json &amp;&amp;</span><br><span class="line">python manage.py loaddata db_doc.json</span><br></pre></td></tr></table></figure>



<h2 id="觅思文档：对站点数据进行备份"><a href="#觅思文档：对站点数据进行备份" class="headerlink" title="觅思文档：对站点数据进行备份"></a>觅思文档：对站点数据进行备份</h2><blockquote>
<p>默认数据库的备份（sqlite数据库）</p>
</blockquote>
<ol>
<li><p>备份 media 文件夹</p>
<p>media 文件夹内保存了用户上传的素材文件（图片、附件等）。</p>
</li>
<li><p>备份 config 文件夹</p>
<p>config 文件夹内存储了 MrDoc 的配置文件、数据库文件。</p>
</li>
</ol>
<blockquote>
<p>自定义数据库的备份</p>
</blockquote>
<ol>
<li><p>备份 media 文件夹</p>
<p>media 文件夹内保存了用户上传的素材文件（图片、附件等）。</p>
</li>
<li><p>备份 config 文件夹</p>
<p>自行按照你所使用的数据库的数据备份方法进行数据库的备份。</p>
</li>
</ol>
<h2 id="觅思文档：忘记管理员密码"><a href="#觅思文档：忘记管理员密码" class="headerlink" title="觅思文档：忘记管理员密码"></a>觅思文档：忘记管理员密码</h2><blockquote>
<p>方法1：直接修改用户密码</p>
</blockquote>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">python manage.py changepassword 用户名</span><br></pre></td></tr></table></figure>

<p>按提示输入新密码即可。</p>
<blockquote>
<p>方法2：新建超级管理员</p>
</blockquote>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">python manage.py createsuperuser</span><br></pre></td></tr></table></figure>

<p>按提示输入信息即可。</p>
<p>然后用这个新创建的管理员用户登录到后台管理页面，对忘记密码的用户进行密码修改：</p>
<h2 id="觅思文档：修改源代码"><a href="#觅思文档：修改源代码" class="headerlink" title="觅思文档：修改源代码"></a>觅思文档：修改源代码</h2><blockquote>
<p>修改文集默认排序</p>
</blockquote>
<p>觅思文档开源版的默认文集排序是根据创建时间(create_time)进行排序的，</p>
<p>通过修改源代码app_doc\views.py，实现首页根据名称排序</p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># 没有搜索 and 认证用户 and 没有筛选</span></span><br><span class="line"><span class="keyword">if</span> (is_kw <span class="keyword">is</span> <span class="literal">False</span>) <span class="keyword">and</span> (is_auth) <span class="keyword">and</span> (is_role <span class="keyword">is</span> <span class="literal">False</span>):</span><br><span class="line">    colla_list = [i.project.<span class="built_in">id</span> <span class="keyword">for</span> i <span class="keyword">in</span> ProjectCollaborator.objects.<span class="built_in">filter</span>(</span><br><span class="line">        user=request.user)]  <span class="comment"># 用户的协作文集列表</span></span><br><span class="line">    project_list = Project.objects.<span class="built_in">filter</span>(</span><br><span class="line">        Q(role__in=role_list) |</span><br><span class="line">        Q(role=<span class="number">2</span>, role_value__contains=<span class="built_in">str</span>(request.user.username)) |</span><br><span class="line">        Q(create_user=request.user) |</span><br><span class="line">        Q(id__in=colla_list)</span><br><span class="line">    ).order_by(<span class="string">&#x27;-is_top&#x27;</span>, <span class="string">&quot;&#123;&#125;name&quot;</span>.<span class="built_in">format</span>(sort_str))</span><br></pre></td></tr></table></figure>

<p>通过修改源代码app_admin\views.py，实现后台管理-文集管理根据名称排序</p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># 获取文集列表</span></span><br><span class="line"><span class="keyword">if</span> kw == <span class="string">&#x27;&#x27;</span>:</span><br><span class="line">    project_list = Project.objects.<span class="built_in">all</span>().order_by(<span class="string">&#x27;-name&#x27;</span>)</span><br><span class="line"><span class="keyword">else</span>:</span><br><span class="line">    project_list = Project.objects.<span class="built_in">filter</span>(</span><br><span class="line">        Q(intro__icontains=kw) | Q(name__icontains=kw),</span><br><span class="line">    ).order_by(<span class="string">&#x27;-name&#x27;</span>)</span><br></pre></td></tr></table></figure>

<p>通过修改源代码app_doc\views.py，实现个人中心-文集管理，根据名称排序</p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># 获取文集列表</span></span><br><span class="line"><span class="keyword">if</span> kw == <span class="string">&#x27;&#x27;</span>:</span><br><span class="line">    project_list = Project.objects.<span class="built_in">filter</span>(</span><br><span class="line">        create_user=request.user).order_by(<span class="string">&#x27;-name&#x27;</span>)</span><br><span class="line"><span class="keyword">else</span>:</span><br><span class="line">    project_list = Project.objects.<span class="built_in">filter</span>(</span><br><span class="line">        Q(intro__icontains=kw) | Q(name__icontains=kw),</span><br><span class="line">        create_user=request.user,</span><br><span class="line">    ).order_by(<span class="string">&#x27;-name&#x27;</span>)</span><br></pre></td></tr></table></figure>





</article><div class="post-copyright"><div class="post-copyright__author"><span class="post-copyright-meta"><i class="fas fa-circle-user fa-fw"></i>文章作者: </span><span class="post-copyright-info"><a href="http://localhost:4000/blog">coderyh</a></span></div><div class="post-copyright__type"><span class="post-copyright-meta"><i class="fas fa-square-arrow-up-right fa-fw"></i>文章链接: </span><span class="post-copyright-info"><a href="http://localhost:4000/blog/20240105205323/">http://localhost:4000/blog/20240105205323/</a></span></div><div class="post-copyright__notice"><span class="post-copyright-meta"><i class="fas fa-circle-exclamation fa-fw"></i>版权声明: </span><span class="post-copyright-info">本博客所有文章除特别声明外，均采用 <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" target="_blank">CC BY-NC-SA 4.0</a> 许可协议。转载请注明来自 <a href="http://localhost:4000/blog" target="_blank">小苑の博客</a>！</span></div></div><div class="tag_share"><div class="post-meta__tag-list"><a class="post-meta__tags" href="/blog/tags/%E9%BB%98%E8%AE%A4%E6%A0%87%E7%AD%BE/">默认标签</a></div><div class="post_share"><div class="social-share" data-image="http://localhost:8080/image?2024-01-05 20:53:23" data-sites="facebook,twitter,wechat,weibo,qq"></div><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/butterfly-extsrc/sharejs/dist/css/share.min.css" media="print" onload="this.media='all'"><script src="https://cdn.jsdelivr.net/npm/butterfly-extsrc/sharejs/dist/js/social-share.min.js" defer></script></div></div><nav class="pagination-post" id="pagination"><div class="prev-post pull-left"><a href="/blog/20240105211227/" title="学习笔记"><img class="cover" src="http://localhost:8080/image?1704460347000" onerror="onerror=null;src='/blog/img/404.jpg'" alt="cover of previous post"><div class="pagination-info"><div class="label">上一篇</div><div class="prev_info">学习笔记</div></div></a></div><div class="next-post pull-right"><a href="/blog/20240105205205/" title="7z系列(一)"><img class="cover" src="http://localhost:8080/image?1704459125000" onerror="onerror=null;src='/blog/img/404.jpg'" alt="cover of next post"><div class="pagination-info"><div class="label">下一篇</div><div class="next_info">7z系列(一)</div></div></a></div></nav><div class="relatedPosts"><div class="headline"><i class="fas fa-thumbs-up fa-fw"></i><span>相关推荐</span></div><div class="relatedPosts-list"><div><a href="/blog/20240105211227/" title="学习笔记"><img class="cover" src="http://localhost:8080/image?1704460347000" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2024-01-05</div><div class="title">学习笔记</div></div></a></div><div><a href="/blog/20240111022327/" title="随机图片接口"><img class="cover" src="http://localhost:8080/image" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2024-01-11</div><div class="title">随机图片接口</div></div></a></div><div><a href="/blog/20240105205205/" title="7z系列(一)"><img class="cover" src="http://localhost:8080/image?1704459125000" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2024-01-05</div><div class="title">7z系列(一)</div></div></a></div><div><a href="/blog/20240103224501/" title="Win10桌面鼠标右键反应慢"><img class="cover" src="http://localhost:8080/image" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2024-01-03</div><div class="title">Win10桌面鼠标右键反应慢</div></div></a></div><div><a href="/blog/20240103214453/" title="将一个程序注册为Windows服务"><img class="cover" src="http://localhost:8080/image?1704289493000" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2024-01-03</div><div class="title">将一个程序注册为Windows服务</div></div></a></div><div><a href="/blog/20231231045518/" title="Bat系列(一)常用命令"><img class="cover" src="http://localhost:8080/image?1703969718000" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2023-12-31</div><div class="title">Bat系列(一)常用命令</div></div></a></div></div></div></div><div class="aside-content" id="aside-content"><div class="sticky_layout"><div class="card-widget" id="card-toc"><div class="item-headline"><i class="fas fa-stream"></i><span>目录</span><span class="toc-percentage"></span></div><div class="toc-content"><ol class="toc"><li class="toc-item toc-level-2"><a class="toc-link" href="#%E8%A7%85%E6%80%9D%E6%96%87%E6%A1%A3%EF%BC%9A%E4%BB%8B%E7%BB%8D"><span class="toc-number">1.</span> <span class="toc-text">觅思文档：介绍</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E8%A7%85%E6%80%9D%E6%96%87%E6%A1%A3%EF%BC%9A%E6%96%87%E9%9B%86%E5%AF%BC%E5%85%A5%E5%92%8C%E5%AF%BC%E5%87%BA"><span class="toc-number">2.</span> <span class="toc-text">觅思文档：文集导入和导出</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E8%A7%85%E6%80%9D%E6%96%87%E6%A1%A3%EF%BC%9A%E6%95%B0%E6%8D%AE%E5%BA%93%E5%88%86%E6%9E%90"><span class="toc-number">3.</span> <span class="toc-text">觅思文档：数据库分析</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E8%A7%85%E6%80%9D%E6%96%87%E6%A1%A3%EF%BC%9A%E5%BC%80%E6%BA%90%E7%89%88%E6%95%B0%E6%8D%AE%E5%AF%BC%E5%85%A5%E4%B8%8E%E5%AF%BC%E5%87%BA"><span class="toc-number">4.</span> <span class="toc-text">觅思文档：开源版数据导入与导出</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E8%A7%85%E6%80%9D%E6%96%87%E6%A1%A3%EF%BC%9A%E5%AF%B9%E7%AB%99%E7%82%B9%E6%95%B0%E6%8D%AE%E8%BF%9B%E8%A1%8C%E5%A4%87%E4%BB%BD"><span class="toc-number">5.</span> <span class="toc-text">觅思文档：对站点数据进行备份</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E8%A7%85%E6%80%9D%E6%96%87%E6%A1%A3%EF%BC%9A%E5%BF%98%E8%AE%B0%E7%AE%A1%E7%90%86%E5%91%98%E5%AF%86%E7%A0%81"><span class="toc-number">6.</span> <span class="toc-text">觅思文档：忘记管理员密码</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E8%A7%85%E6%80%9D%E6%96%87%E6%A1%A3%EF%BC%9A%E4%BF%AE%E6%94%B9%E6%BA%90%E4%BB%A3%E7%A0%81"><span class="toc-number">7.</span> <span class="toc-text">觅思文档：修改源代码</span></a></li></ol></div></div></div></div></main><footer id="footer"><div id="footer-wrap"><div class="copyright">&copy;2023 - 2024 By coderyh</div><div class="framework-info"><span>框架 </span><a target="_blank" rel="noopener" href="https://hexo.io">Hexo</a><span class="footer-separator">|</span><span>主题 </span><a target="_blank" rel="noopener" href="https://github.com/jerryc127/hexo-theme-butterfly">Butterfly</a></div><div class="footer_custom_text">页脚自定义文本</div></div></footer></div><div id="rightside"><div id="rightside-config-hide"><button id="readmode" type="button" title="阅读模式"><i class="fas fa-book-open"></i></button><button id="translateLink" type="button" title="简繁转换">繁</button><button id="darkmode" type="button" title="浅色和深色模式转换"><i class="fas fa-adjust"></i></button><button id="hide-aside-btn" type="button" title="单栏和双栏切换"><i class="fas fa-arrows-alt-h"></i></button></div><div id="rightside-config-show"><button id="rightside-config" type="button" title="设置"><i class="fas fa-cog fa-spin"></i></button><button class="close" id="mobile-toc-button" type="button" title="目录"><i class="fas fa-list-ul"></i></button><button id="go-up" type="button" title="回到顶部"><span class="scroll-percent"></span><i class="fas fa-arrow-up"></i></button></div></div><div><script src="/blog/js/utils.js"></script><script src="/blog/js/main.js"></script><script src="/blog/js/tw_cn.js"></script><script src="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox/fancybox.umd.min.js"></script><script>function panguFn () {
  if (typeof pangu === 'object') pangu.autoSpacingPage()
  else {
    getScript('https://cdn.jsdelivr.net/npm/pangu/dist/browser/pangu.min.js')
      .then(() => {
        pangu.autoSpacingPage()
      })
  }
}

function panguInit () {
  if (false){
    GLOBAL_CONFIG_SITE.isPost && panguFn()
  } else {
    panguFn()
  }
}

document.addEventListener('DOMContentLoaded', panguInit)</script><div class="js-pjax"><script>(() => {
  const $mermaid = document.querySelectorAll('#article-container .mermaid-wrap')
  if ($mermaid.length === 0) return
  const runMermaid = () => {
    window.loadMermaid = true
    const theme = document.documentElement.getAttribute('data-theme') === 'dark' ? 'dark' : 'default'

    Array.from($mermaid).forEach((item, index) => {
      const mermaidSrc = item.firstElementChild
      const mermaidThemeConfig = '%%{init:{ \'theme\':\'' + theme + '\'}}%%\n'
      const mermaidID = 'mermaid-' + index
      const mermaidDefinition = mermaidThemeConfig + mermaidSrc.textContent

      const renderFn = mermaid.render(mermaidID, mermaidDefinition)

      const renderV10 = () => {
        renderFn.then(({svg}) => {
          mermaidSrc.insertAdjacentHTML('afterend', svg)
        })
      }

      const renderV9 = svg => {
        mermaidSrc.insertAdjacentHTML('afterend', svg)
      }

      typeof renderFn === 'string' ? renderV9(renderFn) : renderV10()
    })
  }

  const loadMermaid = () => {
    window.loadMermaid ? runMermaid() : getScript('https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js').then(runMermaid)
  }

  btf.addGlobalFn('themeChange', runMermaid, 'mermaid')

  window.pjax ? loadMermaid() : document.addEventListener('DOMContentLoaded', loadMermaid)
})()</script><script>(() => {
  const abcjsInit = () => {
    const abcjsFn = () => {
      document.querySelectorAll(".abc-music-sheet").forEach(ele => {
        ABCJS.renderAbc(ele, ele.innerHTML, {responsive: 'resize'})
      })
    }
    
    typeof ABCJS === 'object' ? abcjsFn()
      : getScript('https://cdn.jsdelivr.net/npm/abcjs/dist/abcjs-basic-min.min.js').then(abcjsFn)
  }

  window.pjax ? abcjsInit() : window.addEventListener('load', abcjsInit)
})()</script></div><script defer="defer" id="ribbon" src="https://cdn.jsdelivr.net/npm/butterfly-extsrc/dist/canvas-ribbon.min.js" size="150" alpha="0.6" zIndex="-1" mobile="false" data-click="true"></script><script id="click-heart" src="https://cdn.jsdelivr.net/npm/butterfly-extsrc/dist/click-heart.min.js" async="async" mobile="false"></script><script async data-pjax src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script><div id="local-search"><div class="search-dialog"><nav class="search-nav"><span class="search-dialog-title">搜索</span><span id="loading-status"></span><button class="search-close-button"><i class="fas fa-times"></i></button></nav><div class="is-center" id="loading-database"><i class="fas fa-spinner fa-pulse"></i><span>  数据库加载中</span></div><div class="search-wrap"><div id="local-search-input"><div class="local-search-box"><input class="local-search-box--input" placeholder="搜索文章" type="text"/></div></div><hr/><div id="local-search-results"></div><div id="local-search-stats-wrap"></div></div></div><div id="search-mask"></div><script src="/blog/js/search/local-search.js"></script></div></div></body></html>